using AdmissionQA.Application.Common;
using AdmissionQA.Application.Dtos.CampusLife;
using AdmissionQA.Domain.Entities;

namespace AdmissionQA.Application.ServiceInterfaces;

/// <summary>
/// 校园生活服务接口
/// </summary>
public interface ICampusLifeServices
{
    /// <summary>
    /// 创建校园生活信息
    /// </summary>
    /// <param name="campusLife">校园生活信息</param>
    /// <returns>创建结果</returns>
    Task<Result<string>> CreateCampusLifeAsync(CampusLifeDto campusLife);

    /// <summary>
    /// 批量创建校园生活信息
    /// </summary>
    /// <param name="campusLives">校园生活信息列表</param>
    /// <returns>创建结果</returns>
    Task<Result<string>> CreateCampusLivesAsync(CampusLivesDto campusLives);

    /// <summary>
    /// 根据ID获取校园生活信息
    /// </summary>
    /// <param name="id">校园生活信息ID</param>
    /// <returns>校园生活信息</returns>
    Task<Result<CampusLife>> GetCampusLifeByIdAsync(Guid id);

    /// <summary>
    /// 获取所有校园生活信息
    /// </summary>
    /// <returns>校园生活信息列表</returns>
    Task<Result<IEnumerable<CampusLife>>> GetAllCampusLivesAsync();

    /// <summary>
    /// 分页获取校园生活信息
    /// </summary>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">页大小</param>
    /// <returns>分页结果</returns>
    Task<Result<IEnumerable<CampusLife>>> GetPagedCampusLivesAsync(
        int pageIndex = 0,
        int pageSize = 10
    );

    /// <summary>
    /// 根据类别搜索校园生活信息
    /// </summary>
    /// <param name="category">类别</param>
    /// <returns>匹配的校园生活信息列表</returns>
    Task<Result<IEnumerable<CampusLife>>> SearchCampusLivesByCategoryAsync(string category);

    /// <summary>
    /// 更新校园生活信息
    /// </summary>
    /// <param name="id">校园生活信息ID</param>
    /// <param name="campusLife">校园生活信息</param>
    /// <returns>更新结果</returns>
    Task<Result<string>> UpdateCampusLifeAsync(Guid id, CampusLifeDto campusLife);

    /// <summary>
    /// 删除校园生活信息
    /// </summary>
    /// <param name="id">校园生活信息ID</param>
    /// <returns>删除结果</returns>
    Task<Result<string>> DeleteCampusLifeAsync(Guid id);

    /// <summary>
    /// 批量删除校园生活信息
    /// </summary>
    /// <param name="ids">校园生活信息ID列表</param>
    /// <returns>删除结果</returns>
    Task<Result<string>> DeleteCampusLivesAsync(IEnumerable<Guid> ids);

    /// <summary>
    /// 获取校园生活信息总数
    /// </summary>
    /// <returns>校园生活信息总数</returns>
    Task<int> GetCampusLifeCountAsync();

    /// <summary>
    /// 基于向量相似度搜索校园生活信息
    /// </summary>
    /// <param name="text">查询文本</param>
    /// <param name="topK">返回最相似的前K个</param>
    /// <returns>最相似的校园生活信息列表</returns>
    Task<Result<IEnumerable<CampusLife>>> SearchCampusLifesByEmbeddingAsync(string text, int topK = 5);
}
